<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:ez="http://java.sun.com/jsf/composite/ezcomp">
    <!--
    Author Lu Xiaodi
    -->
    <h:head> 
        <title>IOTR</title> 

        <style type="text/css"> 

            .gritter-notice-wrapper { 
                left:200px; 
                top:50px; 
            } 
        </style> 

    </h:head> 
    <h:body>                 
        <ez:TCubeAdminTopMenu/>

        <h1>Integrated Online Ticketing and Reservation (IOTR)</h1> 

        <p:layout style="table-layout:auto; height:600px ">
            <p:layoutUnit position="left" header="Navigation" width="300">
                <ez:TCubeAdminIOTRLeftMenu/>
            </p:layoutUnit>
            <p:layoutUnit position="center" header="Settings">

                <h:form >
                    <h:panelGrid columns="3">
                        <h:outputLabel value="Select User: " />
                        <h:selectOneMenu id="selectUserMenu" value="#{displayCustomerReservationMB.email}">
                            <f:selectItem itemValue="Select User: "/>
                            <f:selectItems var="u" value="#{displayCustomerReservationMB.allUsers}"
                                           itemValue="#{u.email}"
                                           itemLabel="#{u.email}"/>
                        </h:selectOneMenu>
                        <p:message for="selectUserMenu"/>
                        <p:commandButton id="selectOutletSubmit" value="Go" ajax="false"
                                         update="reservations" >
                        </p:commandButton>
                    </h:panelGrid>
                    

                    <br/>
                    <h:outputLabel value="Existing reservations:"/>
                    <br/>
                    <p:dataTable var="r" value="#{displayCustomerReservationMB.reservationByCust}" id="reservations">
                        <f:facet name="header" >
                            <h:outputText value="Customer Reservation History"/>
                        </f:facet>
                        <p:column headerText="Reservation Id">
                            <h:outputText value="#{r.id}"/>
                        </p:column>
                        <p:column headerText="Outlet name" >
                            <h:outputText value="#{r.outletName}"/>
                        </p:column>
                        <p:column headerText="Timeslot">
                            <h:outputText value="#{r.timeslot.time}"/>
                        </p:column>
                        <p:column headerText="Confirm Status">
                            <h:outputText value="#{r.confirmStatus}"/>
                        </p:column>
                        <p:column headerText="Show Up">
                            <h:outputText value="#{r.customerShowUp}"/>
                        </p:column>
                        
                    </p:dataTable>  
                </h:form>
            </p:layoutUnit>
        </p:layout>
    </h:body> 
</html>